Many image display systems have nonlinear responses. A cathode-ray tube (CRT), for example, will generally produce an image in which the relationship between input signal level and output picture element (pixel) luminance is nonlinear. Similarly, a printer will generally produce an image in which the relationship between input signal level and output pixel tone density is nonlinear. Effects of display nonlinearity may include such artifacts as loss of definition in low-light or shadow areas.
In order to achieve a perceptually appropriate reproduction of image tone scale, it is desirable to compensate such nonlinearity. It may be desired to enhance detail in the shadow regions of an image, for example, without causing undue loss of definition in the highlights.
An image acquisition system may include a sensor such as a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) sensor. It may be desired to apply a nonlinear mapping to the output signal of such a sensor. For example, it may be desired to precompensate for display nonlinearity; to compensate for nonlinearity in the sensor response (such as a logarithmic response); and/or to code the signal into a standard, perceptually uniform, and/or device-independent space (such as sRGB, YCrCb, CIE Lab or Luv or XYZ, etc.).
The parameter gamma (γ) is commonly used to characterize a nonlinear reproduction of tone scale. FIG. 1 shows an example in which a nonlinear mapping from normalized input value to normalized output value is modeled by the power function γ=1/(2.2). The operation of applying such a mapping to an image signal is called gamma correction.
The shape of the gamma curve may affect not only the overall color appearance of an image, but also the image brightness and contrast. A gamma correction operation is typically performed on the luminance component of a luminance-chrominance signal, such as the Y component of a YCbCr signal. Alternatively, a gamma correction operation may apply the same mapping to each of the components of a multispectral signal (for example, the R, G, and B components of an RGB signal).
Although computing a nonlinear function such as a power function may be computationally expensive, gamma correction is typically implemented rather efficiently by using a look-up table (LUT) that maps input values to precomputed output values. A pixel value is applied as an index to the table, and the mapped output value is retrieved from the indexed location. In this manner, mapped values may be obtained at run-time with greatly reduced complexity.
One problem with LUT implementation of gamma correction is that the table size grows exponentially with the width of the input values in bits. Image sensors may output pixel values that are 8, 10, 12, or even 14 bits wide. While an LUT for mapping an 8-bit input pixel has only 256 (28) entries, an LUT for mapping 14-bit pixels has 16,384 (214) entries. For many hardware implementations, such a table would take up a prohibitively large area of silicon. Furthermore, for applications that include loading of a gamma curve table at run-time, the operation of loading such a large table may be too time-consuming.